package cn.tedu.hhmc.patient_disease_relation.service.impl;

import java.util.List;

import cn.tedu.hhmc.patient_disease_relation.mapper.PatientDiseaseRelationMapper;
import cn.tedu.hhmc.patient_disease_relation.pojo.entity.PatientDiseaseRelation;
import cn.tedu.hhmc.patient_disease_relation.pojo.vo.PatientDiseaseRelationVO;
import cn.tedu.hhmc.patient_disease_relation.service.IPatientDiseaseRelationService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 病人-疾病关联Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-05
 */
@Slf4j
@Service
public class PatientDiseaseRelationServiceImpl implements IPatientDiseaseRelationService
{
    @Autowired
    private PatientDiseaseRelationMapper patientDiseaseRelationMapper;

    /**
     * 查询病人-疾病关联
     * 
     * @param patientId 病人-疾病关联主键
     * @return 病人-疾病关联
     */
    @Override
    public List<PatientDiseaseRelationVO> selectPatientDiseaseRelationByPatientId(Long patientId)
    {
        return patientDiseaseRelationMapper.selectPatientDiseaseRelationByPatientId(patientId);
    }

    /**
     * 查询病人-疾病关联列表
     * 
     * @param patientDiseaseRelation 病人-疾病关联
     * @return 病人-疾病关联
     */
    @Override
    public List<PatientDiseaseRelationVO> selectPatientDiseaseRelationList(PatientDiseaseRelation patientDiseaseRelation)
    {
        return patientDiseaseRelationMapper.selectPatientDiseaseRelationList(patientDiseaseRelation);
    }

    /**
     * 新增病人-疾病关联
     * 
     * @param patientDiseaseRelation 病人-疾病关联
     * @return 结果
     */
    @Override
    public int insertPatientDiseaseRelation(PatientDiseaseRelation patientDiseaseRelation)
    {
        return patientDiseaseRelationMapper.insertPatientDiseaseRelation(patientDiseaseRelation);
    }

    /**
     * 修改病人-疾病关联
     * 
     * @param patientDiseaseRelation 病人-疾病关联
     * @return 结果
     */
    @Override
    public int updatePatientDiseaseRelation(PatientDiseaseRelation patientDiseaseRelation)
    {
        return patientDiseaseRelationMapper.updatePatientDiseaseRelation(patientDiseaseRelation);
    }

    /**
     * 批量删除病人-疾病关联
     * 
     * @param patientIds 需要删除的病人-疾病关联主键
     * @return 结果
     */
    @Override
    public int deletePatientDiseaseRelationByPatientIds(Long[] patientIds)
    {
        return patientDiseaseRelationMapper.deletePatientDiseaseRelationByPatientIds(patientIds);
    }

    /**
     * 删除病人-疾病关联信息
     * 
     * @param patientId 病人-疾病关联主键
     * @return 结果
     */
    @Override
    public int deletePatientDiseaseRelationByPatientId(Long patientId)
    {
        return patientDiseaseRelationMapper.deletePatientDiseaseRelationByPatientId(patientId);
    }
}
